let rname = document.querySelector('#register-name');
let rpwd = document.querySelector('#register-pwd');
let rcna = document.querySelector('#register-name')
let rcpwd = document.querySelector('#register-pwd')

document.querySelector('#register-btn').onclick = () => {
    let username = rname.value;
    let password = rpwd.value;
    console.log(username, password);

    utils.fetch("./api/v1/user/register.php", { username, password }).then((resp) => {

        if (resp.code === 200) {
            setTimeout(() => {
                $('#registModal').modal('hide')
            }, 1000)
        }
    })
}
$('#registModal').on('hidden.bs.modal', function(e) {
    rcna.value = rcpwd.value = ''
})